package net.golfklubi.sive;

import jdave.Specification;
import jdave.junit4.JDaveRunner;

import net.golfklubi.sive.MySinglevalueConverter;

import org.joda.time.LocalDate;
import org.junit.runner.RunWith;

@RunWith(JDaveRunner.class)
public class MySinglevalueConverterSpec extends Specification<MySinglevalueConverter> {
    final LocalDate localDate = new LocalDate(2009, 2, 1);

    public class Any {

        public void convertsToStringCorrectly() {
            specify(new MySinglevalueConverter().toString(localDate), must.equal("01.02.2009"));
        }

        public void convertsToObjectCorrectly() {
            final String date = "01.02.2009";
            specify(new MySinglevalueConverter().fromString(date), must.equal(localDate));
        }
    }

}
